const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}
// console.log(process.env)
module.exports = {
    lintOnSave: false,
    configureWebpack: (config) => {
        config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
    },
    outputDir: process.env.VUE_APP_OUTPUT_DIR,
    productionSourceMap: false,
    devServer: {
        open: true,
        port: 8888, // 端口
        // proxy: process.env.VUE_APP_WEB_API,
        // proxy: {
        //     '/ai': {
        //         target: process.env.VUE_APP_AI_HTTP_PATH,
        //         changeOrigin: true
        //         // pathRewrite: { '^/py': '' }
        //     },
        //     '/system': {
        //         target: process.env.VUE_APP_WEB_API,
        //         changeOrigin: true
        //     }

        // }

    },
    pages: {
        index: {
            entry: 'src/main.js',
            title: '武汉华星光电t4动力系统智能化'
        }
    },
    chainWebpack(config) {
        config.resolve.alias
            .set('components', resolve('src/components'))
            .set('common', resolve('src/common'))
            .set('api', resolve('src/api'))
            .set('@store', resolve('src/store'))
            .set('@view', resolve('src/view'))
            .set('@', resolve('src'))
            .set('@src', resolve('src'))
            .set('@assets', resolve('src/assets'))
            .set('@components', resolve('src/components'))
            .set('@service', resolve('src/service'))
            .set('@store', resolve('src/store'))
            .set('@view', resolve('src/view'))
            .set('@app', resolve('src/view/app'))
            .set('@mobile', resolve('src/view/mobile'))
            .set('@windows', resolve('src/view/windows'))
            .set('@page', resolve('src/view/page'))
            .set('@system', resolve('src/view/page/system'))
            .set('@vendor', resolve('/src/vendor'))
    }
}